package im.zhaojun.system.service.Impl;

import im.zhaojun.system.mapper.PUpdateMapper;
import im.zhaojun.system.model.PUpdate;
import im.zhaojun.system.service.PUpdateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


@Service
public class PUpdateServiceImpl implements PUpdateService {
    @Autowired
    PUpdateMapper pUpdateMapper;


    @Override
    public List<PUpdate> SelectAllsPUpdate(@RequestParam("variable") String variable, @RequestParam("groups") String groups,
                                           @RequestParam("levels") String levels) {
//        page = (page-1)*limit;
        return pUpdateMapper.SelectAllsPUpdate(variable,groups,levels);
    }

    @Override
    public PUpdate selectById(Integer id) {
        return pUpdateMapper.selectById(id);
    }

    @Override
    public void updateById(Integer id, String variable, String groups, String levels, String recovery, String plimit, String describes) {
        System.out.println(id+variable+groups+"  levels=="+levels+"    recovrery=="+recovery+plimit+describes);
       Integer rows = pUpdateMapper.updateById(id,variable,groups,levels,recovery,plimit,describes);
        System.err.println("rows= "+rows);
    }

    @Override
    public void deleteById(Integer id) {
        pUpdateMapper.deleteById(id);
    }

    @Override
    public void insertPUpdate(PUpdate pUpdate) {
        pUpdateMapper.insert(pUpdate);
    }

//    @Override
//    public Integer selectCounts() {
//        return pUpdateMapper.selectCounts();
//    }



}
